package com.chengweiyi.security.config;

import com.chengweiyi.security.security.DefaultPassWordEncoder;
import com.chengweiyi.security.security.TokenManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;

import javax.annotation.Resource;

/**
 * @Author xiao hu die
 * @Date 2022/5/13 22:21
 * @Version 1.0
 */
@Configuration
public class TokenWebSecurityConfig  extends WebSecurityConfigurerAdapter {
 @Resource
    private TokenManager tokenManager;
 @Resource
 private RedisTemplate redisTemplate;
 @Resource
 private DefaultPassWordEncoder defaultPassWordEncoder;
 @Resource
 private UserDetailsService userDetailsService;

    public TokenWebSecurityConfig(TokenManager tokenManager, RedisTemplate redisTemplate, DefaultPassWordEncoder defaultPassWordEncoder, UserDetailsService userDetailsService) {
        this.tokenManager = tokenManager;
        this.redisTemplate = redisTemplate;
        this.defaultPassWordEncoder = defaultPassWordEncoder;
        this.userDetailsService = userDetailsService;
    }
}
